package com.tuanzhang.zhw.rpc.tests.provider;

import com.tuanzhang.zhw.rpc.config.provider.ProviderConfig;
import com.tuanzhang.zhw.rpc.config.provider.RpcServerConfig;
import com.tuanzhang.zhw.rpc.register.zookeeper.CuratorImpl;
import com.tuanzhang.zhw.rpc.register.zookeeper.RpcRegistryProviderService;
import com.tuanzhang.zhw.rpc.register.zookeeper.ZookeeperClient;
import com.tuanzhang.zhw.rpc.service.impl.UserServiceImpl;

import java.util.ArrayList;
import java.util.List;

public class ZkProviderStarter1 {
    public static void main(String[] args) {
        new Thread(()->{
            try {
                //提供者配置
                ProviderConfig config =new ProviderConfig();
                config.setInterfaceName("com.tuanzhang.zhw.rpc.service.UserService");
                config.setRef(UserServiceImpl.class.newInstance());

                List<ProviderConfig> configList =new ArrayList<>();
                configList.add(config);

                //添加注册中心
                ZookeeperClient zookeeperClient =new CuratorImpl("127.0.0.1:2181",1000);
                RpcRegistryProviderService registryProviderService =new RpcRegistryProviderService(zookeeperClient);



            }catch (Exception e){
                e.printStackTrace();
            }

        }).start();
    }
}
